//
//  UIButtton+Extension.swift
//  WymanWeibo
//
//  Created by wyman on 16/4/14.
//  Copyright © 2016年 wyman. All rights reserved.
//

import UIKit

extension  UIButton {

    convenience init(image: String, bkgImage: String = "timeline_card_bottom_background",title: String, fontSize: CGFloat = 12){
    
        self.init(frame: CGRectZero)
        
        setBackgroundImage(UIImage.init(named: bkgImage), forState: .Normal)
        setBackgroundImage(UIImage.init(named: "\(bkgImage)_highlighted"), forState: .Highlighted)

        setImage(UIImage.init(named: image), forState: .Normal)
    
        
        setTitle(title, forState: .Normal)
        
        setTitleColor(UIColor.lightGrayColor(), forState: .Normal)
        
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
    }
    
}
